package com.byjk.ai.controller;

import com.byjk.ai.service.ChatService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RequiredArgsConstructor
@RestController
@RequestMapping("/ai")
public class ChatController {
    private  final ChatService chatService;

    @GetMapping("/chat")
    public String chat(@RequestParam String message) {
        // 调用服务类进行对话
        return chatService.chat(message);
    }
}
